package com.treasure.mall.biz.entity.log;

import com.treasure.mall.biz.entity.Base2PO;
import com.treasure.mall.zbq.common.constant.Constant;
import com.treasure.mall.zbq.common.ienum.log.AdvanceLogType;
import com.treasure.mall.zbq.common.ienum.log.LogDataType;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * 预存款流水
 *
 * @author guomw
 * @date 2019-10-18
 */
@Entity
@Getter
@Setter
@Table(name = "zb_advance_log")
public class AdvanceLogPO extends Base2PO {

    /**
     * logId
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "log_id")
    private Long logId;

    /**
     * 用户id
     */
    @Column(name = "user_id", length = 10)
    private Long userId;


    /**
     * 数据类型{@link com.treasure.mall.zbq.common.ienum.log.LogDataType}
     */
    @Column(name = "data_type", length = 3)
    private LogDataType dataType;

    /**
     * 日志类型
     */
    @Column(name = "log_type", length = 3)
    private AdvanceLogType logType;

    /**
     * 变动金额
     */
    @Column(name = "amount", scale = Constant.SCALE, precision = Constant.PRECISION)
    private BigDecimal amount;

    /**
     * 变动前金额
     */
    @Column(name = "before_amount", scale = Constant.SCALE, precision = Constant.PRECISION)
    private BigDecimal beforeAmount;

    /**
     * 变动后金额
     */
    @Column(name = "after_amount", scale = Constant.SCALE, precision = Constant.PRECISION)
    private BigDecimal afterAmount;

    /**
     * 订单号
     */
    @Column(name = "order_id", length = 50)
    private String orderId;

    /**
     * 关联的充值id
     */
    @Column(name = "recharge_id", length = 50)
    private String rechargeId;

    /**
     * 备注
     */
    @Column(name = "remark", length = 500)
    private String remark;

    /**
     * 操作员id
     */
    @Column(name = "op_id", length = 10)
    private Integer opId;

    /**
     * 操作员账号
     */
    @Column(name = "op_name", length = 30)
    private String opName;
}